<template>
	<view class="body">
		<view class="list" @tap="seeinfobyid" :data-id="item.id" v-for="item in list">
			
			<view class="list_a font1">{{item.title}}</view>
			<view class="list_b">{{item.createtime}}</view>
			<view class="list_c">{{item.desc}}</view>
			<view style="height: 10rpx;"></view>
		</view>
		
		
		<view class="nolist" v-if="list.length<1">
			<image src="/static/image/nolist.png" mode=""></image>
		</view>
	
	</view>
</template>

<script>
	
		import {curl} from 'common/api.js';
		
	export default {
		data() {
			return {
				list:[]
			}
		},
		
		onLoad() {
			this.getnews();
		},
		
		methods: {
			//最新消息
			getnews(){
				var that=this;
				var page=this.page;
				var lists=this.lists;
				
				curl('index/getmessage', {page:1}).then((res) => {
					console.log('最新消息',res.data);
					var list=res.data;
					that.list=list;
				});
			},
			
			
			seeinfobyid(ret){
				var id=ret.currentTarget.dataset.id;
				uni.navigateTo({
					url:"/pages/message/info?id="+id
				})
			}
		}
	}
</script>
	
<style>
	.list_c{
		width: 660rpx;height: auto;margin: 10rpx auto;
		font-size: 28rpx;color: #333333;
	}
	.list_b{
		width: 660rpx;height: 50rpx;margin: auto;
		font-size: 25rpx;color: #666666;line-height: 50rpx;
	}
	.list_a{
		width: 660rpx;height: auto;margin: auto;
		line-height: 40rpx;
		font-size: 30rpx;color: #000000;font-weight: bold;
	}
	.list{
		width: 700rpx;height: auto;
		border-radius: 10rpx;margin: 20rpx auto;
		background: #ffffff;border-radius: 10rpx;
	}
	
	.body{
		width: 100%;min-height: 100vh;background: #fafafa;
	}

</style>
